/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import entities.Domain;
import entities.Service;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import model.*;
import model.DomainFacade;

/**
 *
 * @author luckyboy
 */
@ManagedBean(name = "domain")
@SessionScoped
public class DomainManagedBean {

    @EJB
    private DomainFacade domainFacade;
    Service sv = new Service();
    Domain domain = new Domain();

    public Domain getDomain() {
        return domain;
    }

    public void setDomain(Domain domain) {
        this.domain = domain;
    }

    public DomainManagedBean(DomainFacade domainFacade) {
        this.domainFacade = domainFacade;
    }

    /**
     * Creates a new instance of DomainManagedBean
     */
    public DomainManagedBean() {
    }

    public List<Domain> findall() {
        return this.domainFacade.findAll();
    }

    public String detail(Domain spp) {
        this.domain = spp;
        return "Service";
    }
}
